<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //1.函数表达式
    var add=function(x,y){ //有无名字都会被隐藏掉
            return x+y;
        }
        console.log(add(3,4));
        //2.定义时就运行，函数定义与执行合二为一
        var result=(function(x,y){
            return x*y;
        })(4,5);
        console.log(result);
        var chu=(function(x,y){
            return x/y;
        })(4,5);
        console.log(chu);
    </script>
</body>
</html>